class ZJHProgressTimer extends eui.Image 
{
    public constructor() {
        super();
    }
    public start(): void {
    }
    public shape: egret.Shape;
    private _value: number = 0;
    public get value(): number {
        return this._value;
    }
    public set value(value: number) {
        var isChanged: boolean = this._value != value;
        this._value = value;
        if (isChanged) {
            this.updateNow();
        }
    }
    public childrenCreated(): void {
        this.updateNow();
    }
    /**
     * 实时更新进度显示
     */
    public updateNow(): void {
        this.visible = this.value != 0;
        if (this.shape) {
            this.parent.removeChild(this.shape);
        }
        var percent: number = -(360 - (this.value / 100 * 360));//从有到无
        //            var percent: number = this.value / 100 * 360;//从无到有
        this.shape = how.DisplayUtils.getSector(
            Math.sqrt(Math.pow(this.width, 2) + Math.pow(this.height, 2)) / 2, 0, percent);
        this.shape.rotation = -90;
        this.shape.x = this.width / 2;
        this.shape.y = this.height / 2;
        this.parent.addChild(this.shape)
        this.mask = this.shape;
    }
}
